package com.kaifamiao.month04.day07.work;

public class Test07 {

    // 求字符串的长度
    public static int myLength(String str) {
        int count = 0;
        while(!"".equals(str)){
            str = str.substring(1);
            count ++;
        }
        return count;
    }

    public static void main(String[] args) {
        String str = "12345dfghj";
        System.out.println(myLength(str));
    }

}
